import { Map } from 'immutable'

const reducer = (state, payload) => {
    if (!state) {
        state = Map({
            open: true
        })
    }
    switch (payload.type) {
        case 'collapse':
            return state.set('open', false)
        case 'open':
            return state.set('open', true)
        default:
            return state
    }
}
export default reducer
